package com.sixth.constant;



import org.springframework.beans.factory.annotation.Autowired;
import sun.plugin2.message.ShowStatusMessage;

import java.util.ArrayList;


import java.util.HashMap;
import java.util.Map;


//常量类
public class Constant {


    //service返回值规范
    //查询成功
    public static final int OK = 200;
    //查询失败
    public static final int NON = 404;

    //十五分钟对应的毫秒数
    public static final long EXPIRATION = 900000;

    //影响数据库一行数据
    public static final int ONE = 1;


    //lixinhang新增 商品类目查询所使用的类目级别
    public static final String FIRST_LEVEL = "L1";  //一级类目
    public static final String SECOND_LEVEL = "L2"; //二级类目


    //表未删除
    public static final boolean EXIST = false;
    //表已删除
    public static final boolean NOEXIST = true;

    // 服务器本机的ip地址
    public static final String SERVER_IP = "localhost";
    // 服务器本机的端口号

    public static final String SERVER_PORT = "8083";
//    public static final String SERVER_PORT= "8090";
//    public static final String SERVER_PORT_EIGHT_ZERO_EIGHT_THREE = "8083";//废弃





    //表示优惠券已经领取过了
    public static final int RECEIVED = 740;
    public static final int NOTLOGIN = 501;
    //用户优惠券状态
    public static final short ZERO = 0;
    public static final short UNUSEED = 0;
    public static final short EXPIRED = 1;
    public static final short COUPON_TYPE_CODE = 2;
    public static final short COUPON_STATUS_USABLE = 0;
    public static final short COUPON_STATUS_REMOVED = 3;


    public static final Map<String, String> CODE_NAME_MAP = new HashMap<>();
    //购物车中表示选中的信息
    public static final Boolean SELECTED = true;
    //订单已过期
    public static final int EXPIRATED = 405;


    static {
        CODE_NAME_MAP.put("ZTO", "中通快递");
        CODE_NAME_MAP.put("YTO", "圆通快递");
        CODE_NAME_MAP.put("YD", "韵达快递");
        CODE_NAME_MAP.put("YZPY", "邮政快递包裹");
        CODE_NAME_MAP.put("EMS", "EMS");
        CODE_NAME_MAP.put("DBL", "德邦快递");
        CODE_NAME_MAP.put("FAST", "快捷快递");
        CODE_NAME_MAP.put("ZJS", "宅急送");
        CODE_NAME_MAP.put("TNT", "TNT快递");
        CODE_NAME_MAP.put("UPS", "UPS快递");
        CODE_NAME_MAP.put("DHL", "DHL快递");
        CODE_NAME_MAP.put("FEDEX", "FEDEX联邦(国内件)");
        CODE_NAME_MAP.put("FEDEX_GJ", "FEDEX联邦(国际件)");
        CODE_NAME_MAP.put("ZTO", "中通快递");
        CODE_NAME_MAP.put("YTO", "圆通快递");
        CODE_NAME_MAP.put("YD", "韵达快递");
        CODE_NAME_MAP.put("YZPY", "邮政快递包裹");
        CODE_NAME_MAP.put("EMS", "EMS");
        CODE_NAME_MAP.put("DBL", "德邦快递");
        CODE_NAME_MAP.put("FAST", "快捷快递");
        CODE_NAME_MAP.put("ZJS", "宅急送");
        CODE_NAME_MAP.put("TNT", "TNT快递");
        CODE_NAME_MAP.put("UPS", "UPS快递");
        CODE_NAME_MAP.put("DHL", "DHL快递");
        CODE_NAME_MAP.put("FEDEX", "FEDEX联邦(国内件)");
        CODE_NAME_MAP.put("FEDEX_GJ", "FEDEX联邦(国际件)");



    }

    //订单状态码与中文的映射，key是状态码，value是中文
    public static final Map<Short,String> ORDER_STATUS = new HashMap<>();

    static {
        CODE_NAME_MAP.put("ZTO", "中通快递");
        CODE_NAME_MAP.put("YTO", "圆通快递");
        CODE_NAME_MAP.put("YD", "韵达快递");
        CODE_NAME_MAP.put("YZPY", "邮政快递包裹");
        CODE_NAME_MAP.put("EMS", "EMS");
        CODE_NAME_MAP.put("DBL", "德邦快递");
        CODE_NAME_MAP.put("FAST", "快捷快递");
        CODE_NAME_MAP.put("ZJS", "宅急送");
        CODE_NAME_MAP.put("TNT", "TNT快递");
        CODE_NAME_MAP.put("UPS", "UPS快递");
        CODE_NAME_MAP.put("DHL", "DHL快递");
        CODE_NAME_MAP.put("FEDEX", "FEDEX联邦(国内件)");
        CODE_NAME_MAP.put("FEDEX_GJ", "FEDEX联邦(国际件)");

        //-----------------------------------------------//
        ORDER_STATUS.put((short) 101,"未付款");
        ORDER_STATUS.put((short) 102,"用户取消");
        ORDER_STATUS.put((short) 103,"系统取消");
        ORDER_STATUS.put((short) 201,"已付款");
        ORDER_STATUS.put((short) 202,"申请退款");
        ORDER_STATUS.put((short) 203,"已退款");
        ORDER_STATUS.put((short) 301,"已发货");
        ORDER_STATUS.put((short) 401,"已收货");
        ORDER_STATUS.put((short) 402,"系统收货");

        ORDER_STATUS.put((short) 403,"已评价");

    }


    //lixinhang新增 订单模块，需要的<订单状态,订单状态码>键值对
    public static final Short UNPAID = 101;
    public static final Short USER_CANCEL = 102;
    public static final Short SYSTEM_CANCEL = 103;
    public static final Short PAID = 201;
    public static final Short REFUNDING = 202;
    public static final Short REFUNDED = 203;
    public static final Short SHIPPED = 301;
    public static final Short USER_RECEIVED = 401;
    public static final Short SYSTEM_RECEIVED = 402;

    // XiaoWJ，登录类型的常量
    public static final String ADMIN_LOGIN = "admin";

    public static final String WX_LOGIN = "wx";




    // XiaoWJ,注册验证码
    public static final String INVALIDATE_CODE = "666666";

    public static final String DEFAULT_AVATARURL = "http://localhost:8083/wx/storage/fetch/zhuzhuxia.jpg";

    // XiaoWJ, 注册失败状态码

    public static final int REGISTER_ERROR_MOBILE_EXIST = 705;

    public static final int REGISTER_ERROR_USERNAME_EXIST = 805;


    //zxy,新增，根据添加时间，降序
    public static final String SORT_ADD_TIME = "add_time";
    public static final String ORDER_DESC = "desc";
    //zxy，新增，用于显示10条；
    // public static final int ZERO = 0;已定义，此条废弃
    public static final int TEN = 10;


}

